home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / ChipCD 6.02.iso / macos / files / dragburn.sit / DragonBurn / Dragon Burn Installer / WebHelp / EHLPDHT2.JS < prev    next >
Text File  |  2002-01-09  |  70KB  |  2,198 lines

  1. //// Segment Begin -- (JavaScript 1.2)
  2. // eHelp« Corporation Dynamic HTML JavaScript 
  3. // Copyright⌐ 1998-2000 eHelp« Corporation.All rights reserved.
  4. // Version=4.42
  5.  
  6. // Warning:Do not modify this file.It is generated by RoboHELP« and changes will be overwritten.
  7.  
  8.  
  9. /// Section Begin  - kadov DHTM (JavaScript 1.2)
  10.  
  11. //Begin to support extended and dropdown text effects.
  12. function kadovIsParagraph(el)
  13. {
  14.     return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
  15. }
  16.  
  17. function kadovInitEachChild(el)
  18. {    
  19.     for(var i=0; i<el.children.length; i++)
  20.     {
  21.         var child = el.children[i];
  22.         if( child.tagName == "SCRIPT" || child.tagName == "!" )
  23.             continue;
  24.  
  25.         if( child.id != "" )
  26.         {
  27.             var tmpID = child.id;
  28.             if( tmpID > "" )
  29.             {
  30.                 // to wipe out the onload effects
  31.                 var onLoadEffect = child.style.getAttribute( "x-on-pageload" );
  32.                 if( (onLoadEffect != null) && (onLoadEffect > "") )
  33.                     child.style.setAttribute( "x-on-pageload", "" );
  34.                 
  35.                 var href = child.getAttribute("href")
  36.                 if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )
  37.                     kadovFilePopupInit(tmpID); // Init for Popup
  38.                 else if( child.className == "dropspot" || child.className == "expandspot" || 
  39.                          child.className == "glossterm" )
  40.                     kadovTextPopupInit(tmpID);// Init for Expanding/Glossary or DropDown text
  41.                 else if( child.className == "trigger")
  42.                     kadovInitTrigger(tmpID);// Init for Trigger
  43.                 else
  44.                     kadovInitEffects(tmpID);// Init for DHTML effects
  45.             }
  46.         }
  47.         
  48.         if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )
  49.             child.start = "mouseover";// to start a AVI file. fileopen doesn't work
  50.  
  51.         kadovInitEachChild(child);
  52.     }
  53. }
  54.  
  55. function kadovRetrieveTextInner(el)
  56. {    
  57.     var x = "";
  58.     if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))
  59.         return x;
  60.  
  61.     if( kadovIsParagraph(el) )
  62.     {
  63.         var strNewID = " ";
  64.         if( el.id != "" )
  65.             strNewID += "id=" + el.id + "_NewSpan ";
  66.         x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";
  67.     }
  68.     else
  69.     {
  70.         for(var i=0; i<el.children.length; i++)
  71.             x += kadovRetrieveTextInner( el.children[i] );
  72.     }
  73.     return x;
  74. }
  75.  
  76. function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )
  77. {    
  78.     var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );
  79.     if( nTagOpen < 0 )
  80.         return strRawHTML;
  81.  
  82.     var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);
  83.     if( nTagClose < nTagOpen )
  84.         return strRawHTML;
  85.         
  86.     if( typeof(nDistance) == "number" && nDistance > 0 )
  87.         if( (nTagClose - nTagOpen) != nDistance )
  88.             return strRawHTML;
  89.         
  90.     var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;
  91.     return     kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );
  92. }
  93.  
  94. function kadovAdjustObjectTag(strRawHTML, nStartPos)
  95. {// adjust object tag for related topics HTML control, because innerHTML misses out the item settings
  96.     
  97.     //Is there any DTC?
  98.     var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';
  99.     var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';
  100.     var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );
  101.     if( nDTCTagOpen < 0 )
  102.         return strRawHTML;
  103.     var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );
  104.     if( nDTCTagClose < nDTCTagOpen)
  105.         return strRawHTML; // no Design Time Controls;
  106.         
  107.     //Is the DTC HTML Help Control?
  108.     var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';
  109.     var strRTObjTagClose = '</OBJECT>';
  110.     var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );
  111.     if( nRTObjTagOpen < nDTCTagOpen )
  112.         return strRawHTML;
  113.     var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );
  114.     if( nRTObjTagClose < nRTObjTagOpen )
  115.         return strRawHTML; // is not a HTML help control
  116.         
  117.     // Is it a related Topics html help control?
  118.     var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';
  119.     if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )
  120.         return strRawHTML;
  121.     
  122.     // does the commented object tag contain a items parameters        
  123.     var strRTItemsOpen = '<param name=Items value="';
  124.     var strRTItemsClose = '$$**$$" >';
  125.     var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);
  126.     if( nRTItemsOpen < nDTCTagOpen )
  127.         return strRawHTML;
  128.     var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);
  129.     if( nRTItemsClose < nRTItemsOpen )
  130.         return strRawHTML;
  131.         
  132.     // found a items string
  133.     var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);
  134.     if( strItems.length < 1 )
  135.         return strRawHTML;
  136.     
  137.     // to reconstruct the item(s) param tag(s)
  138.     var strItemsArray = strItems.split('$$**$$');
  139.     if( strItemsArray.length < 1 )
  140.         return strRawHTML;
  141.     var strRunTimeItemParam = "";
  142.     for( var i = 0; i < strItemsArray.length; i++ )
  143.     {
  144.         strRunTimeItemParam += '<PARAM  NAME="Item' + (i+1);
  145.         strRunTimeItemParam += '"' + '  VALUE="';
  146.         strRunTimeItemParam += strItemsArray[i];
  147.         strRunTimeItemParam += '">';
  148.     }
  149.     
  150.     // to insert the reconstructed item params into runtime object tag
  151.     var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);
  152.     return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);
  153. }
  154.  
  155. function kadovTextPopupOnLoad( el )
  156. {
  157.     if( !CCSSP.bIsWinOS )
  158.         return;
  159.  
  160.     if( typeof(el) == "string" )
  161.         el = document.all.item(el);
  162.  
  163.     var src = el.getAttribute( "x-use-popup" );
  164.     if(!src)
  165.         return;
  166.  
  167.     var name = src;
  168.     if( src.substr(0,1) == "#" ) 
  169.         name = src.substr(1, src.length-1);
  170.     var srcDiv = document.all.item(name);
  171.     if( !srcDiv )
  172.         return 1;
  173.  
  174.     var type = el.getAttribute( "x-popup-type" );
  175.     var setup = el.getAttribute( "x-tmp-setup" );
  176.     var newId = name;
  177.     if( newId.indexOf( "_tmp") <= 0 )
  178.         newId += "_tmp";
  179.  
  180.     if( !setup )
  181.     {
  182.         el.setAttribute( "x-tmp-setup", 1 );
  183.     
  184.         if( type == "pulldown"  )
  185.         {
  186.             var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);
  187.             var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
  188.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
  189.  
  190.             //work around the bug in HH.exe that highlight the phrases when use Search tab
  191.             //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime
  192.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);
  193.             
  194.             var strStyle = " style='display:none; position:relative;";
  195.             var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";
  196.  
  197.             srcDiv.outerHTML = ""; // empty the original DIV tag
  198.             var elParentPra = kadovFindParentParagraph(el);
  199.             if( elParentPra )
  200.                 elParentPra.insertAdjacentHTML( "AfterEnd", newDiv );
  201.         }
  202.         else if( type == "expanding"  )
  203.         {
  204.             var inner = kadovRetrieveTextInner(srcDiv);
  205.             if( inner == "" )
  206.                 inner = srcDiv.innerHTML;
  207.             var strAdjust = kadovAdjustObjectTag(inner,0);
  208.             var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
  209.             strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
  210.             var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";
  211.             var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";
  212.             srcDiv.outerHTML = ""; // empty the original DIV tag
  213.             el.insertAdjacentHTML( "AfterEnd", newSpan );
  214.         }
  215.     }
  216. }
  217.  
  218. function kadovTextPopup( el )
  219. {
  220.     if( (!CCSSP.bIsWinOS) || (window.event == null) )
  221.         return;
  222.     window.event.cancelBubble = true;
  223.  
  224.     if( typeof(el) == "string" )
  225.         el = document.all.item(el);
  226.  
  227.     var src = el.getAttribute( "x-use-popup" );
  228.     if(!src)
  229.         return 1;
  230.  
  231.     var name = src;
  232.     if( src.substr(0,1) == "#" ) 
  233.         name = src.substr(1, src.length-1) + "_tmp";
  234.     var srcDiv = document.all.item(name);
  235.     if( !srcDiv )
  236.         return 1;
  237.  
  238.     var type = el.getAttribute( "x-popup-type" );
  239.     var setup = el.getAttribute( "x-tmp-setup" );
  240.     if( srcDiv )
  241.     {
  242.         if( srcDiv.style.display == "" )
  243.             srcDiv.style.display = "none";
  244.         else
  245.         {
  246.             srcDiv.style.display = "";
  247.             kadovInitEffects(name);
  248.             kadovInitEachChild(srcDiv);
  249.         }
  250.     }
  251. }
  252.  
  253. function kadovFindParentParagraph( el )
  254. {
  255.     if( typeof(el) == "string" )
  256.         el = document.all.item(el);
  257.     if( (!el) || el.tagName == "BODY" )
  258.         return null;
  259.     if( kadovIsParagraph(el.parentElement) )
  260.         return el.parentElement;
  261.     else
  262.         return kadovFindParentParagraph( el.parentElement );
  263. }
  264.  
  265. //Begin HTML code invoked function
  266. function kadovRegisterEventHandler( obj, strEvent, strEventHandler )
  267. {
  268.     if( !gbBsIE4 )
  269.         return;
  270.     CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );
  271. }
  272.  
  273. function kadovTextPopupInit( el )
  274. {
  275.     if( (!gbBsIE4) || (!CCSSP.bIsWinOS) )
  276.         return;
  277.         
  278.     if( typeof(el) == "string" )
  279.         el = document.all.item(el);
  280.     if( el != null )
  281.     {
  282.         CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(" + el.id +");" );
  283.         CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(" + el.id +");" );
  284.     }
  285. }
  286. //End HTML code invoked function
  287.  
  288. //End to support extended and dropdown text effects.
  289.  
  290. //Begin to convert iWrite format to RoboEditor Format for DHTML effects
  291. function kadovInitTriggersInHead( )
  292. {
  293.   if( Object.xDelayedInitElements )
  294.   {
  295.      var x = Object.xDelayedInitElements;
  296.      for(i=0; i<x.length; i++)
  297.          kadovInitTrigger( x[i] );
  298.   }
  299. }
  300.  
  301. //Begin HTML code invoked function
  302. function kadovFilePopupInit( el )
  303. {
  304.     if( !gbBsIE4 )
  305.         return;
  306.     if( typeof(el) == "string" )
  307.         el = document.all.item(el);
  308.  
  309.     //_BSSCCreatePopupDivOnWriteForKodav();
  310.  
  311.     if( el != null )
  312.         CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );
  313. }
  314.  
  315. function kadovInitTrigger( element )
  316. {
  317.     if( !gbBsIE4 )
  318.         return;
  319.     var srcElement = element;
  320.     if( typeof(srcElement) == "string" )
  321.     {
  322.         srcElement = document.all.item(element,0);
  323.         if(srcElement == null)
  324.             return;
  325.     }
  326.     
  327.     if( !kadovIsParentVisible(srcElement) )
  328.         return;
  329.  
  330.     var targets = srcElement.getAttribute( "x-targets" );
  331.     var arrOneTarget = targets.split( "," );
  332.     for( var i = 0; i < arrOneTarget.length; i ++ )
  333.         bsscFXInit( element, arrOneTarget[i], null, null, null, null );
  334. }
  335.  
  336. function kadovIsParentVisible( el )
  337. {
  338.     if( typeof(el) == "string" )
  339.         el = document.all.item(el);
  340.     if( (!el) || el.tagName == "BODY" )
  341.         return true;
  342.     if( el.style.display == 'none' ) //el.visibility == 'hidden' || 
  343.         return false;
  344.     else
  345.         return kadovIsParentVisible( el.parentElement );
  346. }
  347.  
  348. function kadovInitEffects( element )
  349. {
  350.     if( !gbBsIE4 )
  351.         return;
  352.     var srcElement = element;
  353.     if( typeof(srcElement) == "string" )
  354.     {
  355.         srcElement = document.all.item(element,0);
  356.         if(srcElement == null)
  357.             return;
  358.     }
  359.     
  360.     if( !kadovIsParentVisible(srcElement) )
  361.         return;
  362.     
  363.     kadovInitEffect( srcElement, "x-on-hover" );
  364.     kadovInitEffect( srcElement, "x-on-pageclick" );
  365.     kadovInitEffect( srcElement, "x-on-pageload" );
  366.     kadovInitEffect( srcElement, "x-on-trigger-1" );
  367.     kadovInitEffect( srcElement, "x-on-trigger-2" );
  368. }
  369. //End HTML code invoked function
  370.  
  371. function kadovInitEffect( element, prop )
  372. {
  373.     var values = null;
  374.     if( element.getAttribute( "currentStyle" ) )
  375.         values = element.currentStyle.getAttribute( prop );
  376.     else 
  377.         values = element.style.getAttribute( prop );
  378.     if( !values )
  379.         return;
  380.  
  381.     var functions = new Array();
  382.     var nIdx = 0, nStart = 0;
  383.     var nNext = values.indexOf( "\)", 0);
  384.     while( nNext >= 0 && nNext < values.length )
  385.     {
  386.         functions[nIdx] = values.substr( nStart, nNext-nStart+1);
  387.         nStart = nNext + 1;
  388.         nIdx++;
  389.         nNext = values.indexOf( "\)", nStart);
  390.     }
  391.         
  392.     for( var i=0; i<functions.length; i++)
  393.     {
  394.         var id = element.getAttribute( "id" );
  395.         var translatedProp = kadovTranslateProp(prop);
  396.  
  397.         var lp = functions[i].indexOf( "(" );
  398.         var fnname = functions[i].substring(0, lp);
  399.         var srcargs = functions[i].substring(lp+1, functions[i].length-1);
  400.         
  401.         var nClickTimes = 1;
  402.         var arrForClickCount = srcargs.split( "," );
  403.         for( var j = 0; j < arrForClickCount.length; j++ )
  404.         {// to locate and get the "clicks=99" settings
  405.             var nPageClick = arrForClickCount[j].indexOf("clicks");
  406.             if( nPageClick >= 0 )
  407.             {
  408.                 nPageClick = arrForClickCount[j].indexOf("=");
  409.                 if( nPageClick > 0 )
  410.                 {
  411.                     nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;
  412.                     break;
  413.                 }
  414.             }
  415.         }
  416.         var args = srcargs;
  417.         if( j < arrForClickCount.length )
  418.         {// to strip out the "clicks=99" from the arguments string
  419.             args = "";
  420.             for( var k = 0; k < arrForClickCount.length; k ++ )
  421.             {
  422.                 if( k != j )
  423.                 {
  424.                     args += arrForClickCount[k];
  425.                     if( k < arrForClickCount.length - 1 )
  426.                         args += ",";
  427.                 }
  428.             }
  429.         }
  430.         bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );
  431.     }
  432. }
  433.  
  434. function kadovTranslateProp( prop )
  435. {
  436.     switch( prop )
  437.     {
  438.     case "x-on-hover" :     return "bsschover";
  439.     case "x-on-pageclick" : return "bsscpageclick";
  440.     case "x-on-pageload" :  return "bsscpageload";
  441.     case "x-on-trigger-1" : return "bssctrigger1";
  442.     case "x-on-trigger-2" : return "bssctrigger2";
  443.     }
  444.     return null;
  445. }
  446. //End to convert iWrite format to RoboEditor Format for DHTML effects
  447.  
  448. //Begin the definition of one entry to DHTML effects
  449. function bsscFXInit( trigger_ID, target_ID, event_type, 
  450.     action_type, action_setting, event_addional )
  451. {
  452.     if( !CCSSP.bIsWinOS || typeof(target_ID) != "string" )//MUST have a target_ID
  453.         return; // we don't support Navigator yet
  454.     
  455.     if( typeof(event_type) == "string" )
  456.         event_type = event_type.toLowerCase();
  457.     if( typeof(action_type) == "string" )
  458.         action_type = action_type.toLowerCase();
  459.     if( typeof(action_setting) == "string" )
  460.          action_setting = action_setting.toLowerCase();
  461.     
  462.     // to get the target element then add it to the target list
  463.     var eleTarget = CCSSP.GetObject( target_ID );
  464.     if( (eleTarget != null) && (event_type != null) && (action_type != null) )
  465.     {
  466.         CEngine.AddOneTarget( target_ID, eleTarget );
  467.         CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);
  468.     }
  469.     
  470.     // to validate the trigger_ID parameter
  471.     if( typeof(trigger_ID) == "string" && trigger_ID != "" )
  472.         CEngine.BuildTriggerObject( trigger_ID, target_ID );
  473. }    
  474. //End the definition of one entry to DHTML effects
  475.  
  476.  
  477. /// Section End  - kadov DHTM (JavaScript 1.2)
  478.  
  479.  
  480. /// Section Begin  - CCSSP DHTM (JavaScript 1.2)
  481.  
  482. //Begin JavaScript libary for cross-platform positioning object.
  483. function CCSSP(){} // constructor of CCSSP class
  484.  
  485. CCSSP.strAgent = navigator.userAgent.toLowerCase(); 
  486. CCSSP.nAppVersion = parseInt(navigator.appVersion);
  487.  
  488. CCSSP.bIsWinOS = ((CCSSP.strAgent.indexOf("win") >= 0) || (CCSSP.strAgent.indexOf("16bit") >= 0));
  489. CCSSP.bIsMacOS = (CCSSP.strAgent.indexOf("mac") >= 0);
  490.  
  491. CCSSP.bIsIE = (navigator.appName.indexOf("Microsoft") >= 0);
  492. CCSSP.bIsIE4 = (CCSSP.bIsIE && (CCSSP.nAppVersion >= 4));
  493. CCSSP.bIsIE5 = (CCSSP.bIsIE4 && (CCSSP.strAgent.indexOf("msie 5") != -1) )
  494.  
  495. CCSSP.bIsNav = (navigator.appName.indexOf("Netscape") >= 0);
  496. CCSSP.bIsNav4 = (CCSSP.bIsNav && (CCSSP.nAppVersion >= 4));
  497.  
  498. CCSSP.GetObject = function( obj )
  499. {//convert object name string or reference into a valid object reference
  500.     if( typeof(obj) == "object" )
  501.         return obj;
  502.     else if( typeof(obj) == "string" && obj != "")
  503.     {
  504.         if( CCSSP.bIsNav4 )
  505.             return eval("document." + obj);
  506.         else
  507.             return eval("document.all." + obj);
  508.     }
  509.     else
  510.         return null;
  511. }
  512.  
  513. CCSSP.MoveObjectTo = function(obj, x, y)
  514. {//positioning an object at a specific pixel coordinate
  515.     if( CCSSP.bIsNav4 )
  516.         obj.moveTo(x,y);
  517.     else
  518.     {
  519.         obj.style.pixelLeft = x;
  520.         obj.style.pixelTop = y;
  521.     }
  522. }
  523.  
  524. CCSSP.MoveObjectBy = function(obj, dx, dy)
  525. {//moveing a object by x and/or y pixel
  526.     if( CCSSP.bIsNav4 )
  527.         obj.moveBy(dx,dy);
  528.     else
  529.     {
  530.         obj.style.pixelLeft += dx;
  531.         obj.style.pixelTop += dy;
  532.     }
  533. }
  534.  
  535. CCSSP.SetObjectBGColor = function(obj, color)
  536. {//set the background color of an object
  537.     if( CCSSP.bIsNav4 )
  538.         obj.bgColor = color;
  539.     else
  540.         obj.style.backgroundColor = color;
  541. }
  542.  
  543. CCSSP.ShowObject = function(obj, bShow)
  544. {// set the object to be visible or invisible
  545.     if( CCSSP.bIsNav4 )
  546.         obj.visibility = (bShow == true) ? 'show' : 'hide';
  547.     else
  548.         obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
  549. }
  550.  
  551. CCSSP.GetObjectLeft = function(obj)
  552. {// retrieve the x coordinate of a posionable object
  553.     if( CCSSP.bIsNav4 )
  554.         return obj.left;
  555.     else
  556.         return obj.style.pixelLeft;
  557. }
  558.  
  559. CCSSP.GetObjectTop = function(obj)
  560. {// retrieve the y coordinate of a posionable object
  561.     if( CCSSP.bIsNav4 )
  562.         return obj.top;
  563.     else
  564.         return obj.style.pixelTop;
  565. }
  566.  
  567. CCSSP.GetObjectContainLeft = function(obj)
  568. {// retrieve the x coordinate of a posionable object relative to it's parent element
  569.     if( CCSSP.bIsNav4 )
  570.         return obj.pageX;
  571.     else
  572.     {
  573.         if( obj == document.body )
  574.             return obj.clientLeft;
  575.         else
  576.             return obj.offsetLeft;
  577.     }
  578. }
  579.  
  580. CCSSP.GetObjectWindowLeft = function(obj)
  581. {// retrieve the x coordinate of a posionable object relative to browser window
  582.     if( CCSSP.bIsNav4 )
  583.         return obj.pageX;
  584.     else
  585.     {
  586.         var nOffsetWindowLeft = 0;
  587.         for(var element = obj; element; element = element.offsetParent)
  588.             nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
  589.         return nOffsetWindowLeft;
  590.     }
  591. }
  592.  
  593. CCSSP.GetObjectContainTop = function(obj)
  594. {// retrieve the y coordinate of a posionable object relative to it's parent element
  595.     if( CCSSP.bIsNav4 )
  596.         return obj.pageY;
  597.     else
  598.     {
  599.         if( obj == document.body )
  600.             return obj.clientTop;
  601.         else
  602.             return obj.offsetTop;
  603.     }
  604. }
  605.  
  606. CCSSP.GetObjectWindowTop = function(obj)
  607. {// retrieve the y coordinate of a posionable object relative to browser window
  608.     if( CCSSP.bIsNav4 )
  609.         return obj.pageY;
  610.     else
  611.     {
  612.         var nOffsetWindowTop = 0;
  613.         for(var element = obj; element; element = element.offsetParent)
  614.             nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
  615.         return nOffsetWindowTop;
  616.     }
  617. }
  618.  
  619. CCSSP.GetObjectHeight = function(obj)
  620. {// retrieve the height of a posionable object
  621.     if( CCSSP.bIsNav4 )
  622.         return obj.clip.height;
  623.     else
  624.         return obj.offsetHeight;
  625. }
  626.  
  627. CCSSP.GetObjectWidth = function(obj)
  628. {// retrieve the width of a posionable object
  629.     if( CCSSP.bIsNav4 )
  630.         return obj.clip.width;
  631.     else
  632.         return obj.offsetWidth;
  633. }
  634.  
  635. CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
  636. { // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
  637.     var oldHandler = "";
  638.     var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
  639.     if( oldInlineHandler != null )
  640.     {
  641.         var functionDefinition = oldInlineHandler.toString();
  642.         var bodyStart = functionDefinition.indexOf( "{" );
  643.         var bodyEnd = functionDefinition.lastIndexOf( "}" );
  644.         if( bodyStart > 0 || bodyEnd > bodyStart )
  645.             oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
  646.     }
  647.     else if( CCSSP.bIsIE4 )
  648.     { //search for <SCRIPT> tag which define the event handler
  649.         for( var i = 0; i < document.scripts.length; i++ ) 
  650.         {
  651.             var script = document.scripts[i];
  652.             if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
  653.             {
  654.                 oldHandler = script.innerHTML;
  655.                 break;
  656.             }
  657.         }
  658.     }
  659.     
  660.     if( oldHandler.indexOf(funcHandler) >= 0 )
  661.         return;// to prevent register the funtion twice.
  662.  
  663.     if( CCSSP.bIsNav4 ) // only "onload, onresize, onfocus" apply to window
  664.     {// other raw events will apply to layer
  665.         var noOn = rawEventName.substring(2, rawEventName.length);
  666.         if( typeof(noOn) == "string" && noOn.length > 3 )
  667.             srcObj.captureEvents( Event[noOn.toUpperCase()] );
  668.     }
  669.  
  670.     var newHandler = oldHandler;
  671.     if( newHandler.length == 0 )
  672.         newHandler = funcHandler;
  673.     else
  674.         newHandler += "; " + funcHandler;
  675.     srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
  676. }
  677.  
  678. CCSSP.GetWindowHeight = function()
  679. {// retrieve the height of available content in browser window
  680.     if( CCSSP.bIsNav4 )
  681.         return window.innerHeight;
  682.     else
  683.         return document.body.clientHeight;
  684. }
  685.  
  686. CCSSP.GetWindowBottom = function()
  687. {// retrieve the bottom postion of browser window
  688.     if( CCSSP.bIsNav4 )
  689.         return window.outerHeight + window.pageYOffset;
  690.     else
  691.         return document.body.clientHeight + document.body.scrollTop;
  692. }
  693.  
  694. CCSSP.GetWindowWidth = function()
  695. {// retrieve the width of available content in browser window
  696.     if( CCSSP.bIsNav4 )
  697.         return window.innerWidth;
  698.     else
  699.         return document.body.clientWidth;
  700. }
  701.  
  702. CCSSP.GetWindowRight = function()
  703. {// retrieve the right postion of browser window
  704.     if( CCSSP.bIsNav4 )
  705.         return window.outerWidth + window.pageXOffset;
  706.     else
  707.         return document.body.clientWidth + document.body.scrollLeft;
  708. }
  709.  
  710. CCSSP.TrimString = function( objString, subtrim )
  711. {// to trim the "subtrim" in the beginning and ending of a string object
  712.     if( typeof(subtrim) != "string" || subtrim == null )
  713.         return objString;
  714.     var strHead = objString.substring(0, 1);
  715.     var strRear = objString.substring(objString.length-1, objString.length);
  716.     if( strHead != subtrim && strRear != subtrim )
  717.         return objString;
  718.     
  719.     var spacePos = objString.indexOf(subtrim);
  720.     if( spacePos < 0 )
  721.         return objString;
  722.     else if( spacePos == objString.length - 1 )
  723.         return objString.substring(0, spacePos);
  724.     else
  725.     {
  726.         var newString = objString.substring( spacePos + 1, objString.length);
  727.         return CCSSP.TrimString( newString, subtrim );
  728.     }
  729. }
  730.  
  731. CCSSP.TrimSpace = function( objString )
  732. {
  733.     var Trim1 = CCSSP.TrimString( objString, " ");
  734.     return CCSSP.TrimString( Trim1, "\'");
  735. }
  736.  
  737. CCSSP.GetEventElement = function( navEventObject )
  738. {// to get the element who fired the current event
  739.     if( CCSSP.bIsNav4 )
  740.         return navEventObject.target;
  741.     else
  742.         return event.srcElement;
  743. }
  744.  
  745. CCSSP.PrepareFilter = function( Obj )
  746. {//to prepare for making the filter work
  747.     Obj.style.filter = "";
  748.     if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
  749.         return;
  750.     Obj.style.height = CCSSP.GetObjectHeight(Obj);
  751. }
  752.  
  753. CCSSP.IsDescendant = function( progenitor, progeny )
  754. {
  755.     if( typeof(progeny) == "undefined" || progeny == null )
  756.         return false;
  757.     else if( progeny == progenitor )
  758.         return true; 
  759.     else if( progeny.id == progenitor.id ) 
  760.         return true; 
  761.     else if( progeny.parentElement == progenitor.parentElement )
  762.         return false;
  763.     else
  764.         return CCSSP.IsDescendant( progenitor, progeny.parentElement );
  765. }
  766.  
  767. CCSSP.IsTextTag = function( Obj )
  768. {
  769.     if( typeof( Obj.tagName ) == "undefined" )
  770.         return false;
  771.     return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" || 
  772.             Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
  773. }
  774.  
  775. //End JavaScript libary for cross-platform positioning object.
  776.  
  777. /// Section End  - CCSSP DHTM (JavaScript 1.2)
  778.  
  779. /// Section Begin  - CCSSP DHTM 1 (JavaScript 1.2)
  780.  
  781. //Begin the definition of class CTrigger
  782. function CTrigger( TriggerElement )
  783. {
  784.     // object : the trigger element. Never be null. 
  785.     this.eleTrigger = TriggerElement;
  786.     
  787.     // number : the click counter number: only 3 values: 0,1,2;
  788.     this.nCounter = 0; 
  789.     
  790.     //object as associative array of string:
  791.     // the associate target ID strings; one element at least.            
  792.     this.objStrTarget = new Object();
  793.     this.eleTrigger.style.cursor = "hand";
  794.     if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )
  795.         this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map
  796. }
  797.  
  798. CTrigger.prototype.AddTargetID = function( strTargetID )
  799. {// add one target ID string to the objStrTarget
  800.     if( typeof(strTargetID) != "string" )
  801.         return ;
  802.     if( typeof(this.objStrTarget[strTargetID]) != "string" )
  803.         this.objStrTarget[strTargetID] = strTargetID;
  804. }
  805.  
  806. CTrigger.prototype.OnTriggerClick = function()
  807. {// to activate all asociated target
  808.     var strEventType = ( (this.nCounter++)% 2 == 0 ) ? 
  809.         "bssctrigger1" : "bssctrigger2";
  810.         
  811.     // to enumerate associative target element's ID string
  812.     for( var strTargetID in this.objStrTarget ) 
  813.         CEngine.SendEventToOneTarget( strTargetID, strEventType );
  814. }
  815. //End the definition of class CTrigger
  816.  
  817. //Begin the definition of class CTarget
  818. function CTarget( TargetElement )
  819. {
  820.     // object : the target element. Never be null.
  821.     this.eleTarget = TargetElement;
  822.     this.objManager = new Object(); // object: the event manager
  823.  
  824. CTarget.nPageClickCounter = 0;// static class property.
  825.  
  826. CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )
  827. {// return the action agency ( effect )object's refernece 
  828.     switch( str_action_type )
  829.     {
  830.     case "show":return new CAgencyShow( this.eleTarget, true ) ;
  831.     case "hide":return new CAgencyShow( this.eleTarget, false ) ;
  832.  
  833.     case "flyin" : 
  834.         return new CAgencyFly(this.eleTarget, action_setting, true);
  835.     case "flyout" : 
  836.         return new CAgencyFly(this.eleTarget, action_setting, false);
  837.     case "spiralin" : 
  838.         return new CAgencySpiral(this.eleTarget, action_setting, true);
  839.     case "spiralout" : 
  840.         return new CAgencySpiral(this.eleTarget, action_setting, false);
  841.     case "zoomin" :
  842.         return new CAgencyZoom(this.eleTarget, action_setting, true);
  843.     case "zoomout" : 
  844.         return new CAgencyZoom(this.eleTarget, action_setting, false);
  845.     case "elastic" : 
  846.         return new CAgencyElastic(this.eleTarget, action_setting);
  847.         
  848.     case "fadein" : 
  849.         return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;
  850.     case "fadeout" :
  851.         return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;
  852.     case "rockrollstatic" :
  853.     case "rockroll" :
  854.         return (CCSSP.bIsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;
  855.  
  856.     case "glow":
  857.         return (CCSSP.bIsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;
  858.     case "dropshadow":
  859.         return (CCSSP.bIsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;
  860.     case "transition" :
  861.         return (CCSSP.bIsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;
  862.     case "blur" :
  863.         return (CCSSP.bIsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;
  864.  
  865.     case "fliph" : // all these 4 do NOT need any parameters
  866.     case "flipv" :
  867.     case "invert":
  868.     case "gray" :
  869.         return (CCSSP.bIsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;
  870.     
  871.     case "fontchange": // the effects below change the style on the fly, so won't work in Navigator
  872.         return (CCSSP.bIsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;
  873.     case "boderchange": 
  874.     case "stylechange":
  875.         return (CCSSP.bIsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;
  876.  
  877.     default: return null;
  878.     }
  879. }
  880.  
  881. CTarget.prototype.SetEventManager = function( 
  882.     one_event_type,str_action_type,action_setting,event_additional)
  883. {// to set the event manager with specified action 
  884.     if( typeof( one_event_type ) != "string" ||    
  885.         typeof( str_action_type ) != "string"||
  886.         typeof( action_setting ) != "string" )
  887.         return false;
  888.     if( typeof(this.objManager[one_event_type]) == "undefined" )
  889.     {
  890.         this.objManager[one_event_type] = new Object();
  891.         this.objManager[one_event_type].length = 0;
  892.     }
  893.     
  894.     var eventAgency = this.GetAgencyObject(str_action_type,action_setting);
  895.     if( eventAgency != null )
  896.     {
  897.         var ct = this.objManager[one_event_type].length ++;
  898.         this.objManager[one_event_type][ct] = eventAgency;
  899.         
  900.         if( one_event_type == "bsscpageclick" )
  901.         {// to deal with the "number of pageclick" stuff
  902.             if( typeof(event_additional) == "number" )
  903.                 this.objManager[one_event_type][ct].nPageClick = event_additional;
  904.             else // set the default number 
  905.                 this.objManager[one_event_type][ct].nPageClick = 1;
  906.             
  907.             if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||
  908.                 (this.objManager[one_event_type][ct].nPageClick < 
  909.                     this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )
  910.                 this.objManager.nMinPageClickIndex = ct;
  911.         }
  912.         
  913.         //hide the object blindly,SetState function will take care of the final correct state
  914.         if( ((one_event_type == "bsscpageclick") && 
  915.              (this.objManager[one_event_type][ct].nPageClick == 1)) ||
  916.             one_event_type == "bsscpageload" ||
  917.             one_event_type == "bssctrigger1" )
  918.             CCSSP.ShowObject( this.eleTarget, false );
  919.         return true;
  920.     }
  921.     return false;
  922. }
  923.  
  924. CTarget.prototype.OnEvent = function( strBsscEvent )
  925. {// response to the event ( bssc format )
  926.     if( typeof(this.objManager[strBsscEvent]) == "object" )
  927.     { // to get the event agency from the event manager
  928.         var eventAgency = this.objManager[strBsscEvent];
  929.         for( var i = 0; i < eventAgency.length; i++ )
  930.         {
  931.             if( strBsscEvent == "bsscpageclick" && 
  932.                  eventAgency[i].nPageClick != CTarget.nPageClickCounter )
  933.                  continue;
  934.             else if( strBsscEvent == "bsschover" && event.type == "mouseout" )
  935.                 eventAgency[i].EndEffect();
  936.             else // to invoke the unified function in effect object    
  937.                 eventAgency[i].UpdateEffect(); 
  938.         }
  939.     }
  940. }
  941.  
  942. CTarget.prototype.SetState = function( strBsscEvent )
  943. {
  944.     if( typeof(this.objManager[strBsscEvent]) != "object" )
  945.         return false;
  946.  
  947.     // to get the event agency from the event manager
  948.     var eventAgency = this.objManager[strBsscEvent];
  949.     
  950.     if( strBsscEvent == "bsscpageclick" )
  951.     {// we only set the initial state for the minium number of pageclick 
  952.         eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();
  953.         return true;
  954.     }
  955.     else
  956.     {
  957.         for( var i = 0; i < eventAgency.length; i++ )
  958.             eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object     
  959.         if( i > 0 )
  960.             return true;
  961.         else
  962.             return false;
  963.     }
  964. }
  965. //End the definition of class CTarget
  966.  
  967. //Begin the definition of CEngine class
  968. function CEngine(){}// all properities are going be "class" properities
  969.  
  970. // object : as associative array of trigger objects
  971. CEngine.objTrigger = new Object();
  972. // object : as associative array of target objects 
  973. CEngine.objTarget = new Object(); 
  974.  
  975. // Array : each element is a CAgencyXXX animation object
  976. CEngine.arrAnimation = new Array();
  977. CEngine.PerformAnimation = function( nIndex )
  978. {// animation : update effects function
  979.     CEngine.arrAnimation[nIndex].UpdateEffect();
  980. }
  981.  
  982. CEngine.AddOneTrigger = function(TriggerID,TriggerElement)
  983. {// add one Trigger object into the trigger array
  984.     if( typeof(TriggerID) != "string" || TriggerElement == null ||
  985.         typeof(TriggerElement) != "object" )
  986.         return;
  987.     if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )
  988.         CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);
  989. }
  990.     
  991. CEngine.AddOneTarget = function(TargetID, TargetElement)
  992. {// add one Target object into the target array
  993.     if( typeof(TargetID) != "string" || TargetElement == null ||
  994.         typeof(TargetElement) != "object" )
  995.         return;
  996.     if( typeof(CEngine.objTarget[TargetID]) != "object" )
  997.         CEngine.objTarget[TargetID] = new CTarget( TargetElement );
  998. }
  999.  
  1000. CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )
  1001. {// to activate one target object
  1002.     if( typeof(CEngine.objTarget[strTargetID]) == "object" ) 
  1003.         CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );
  1004. }
  1005.  
  1006. CEngine.SendEventToAllTarget = function( strBsscEvent )
  1007. { //to activate all target associative to the BSSC event
  1008.     for( var strTargetID in CEngine.objTarget ) //to enumerate all target
  1009.         CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );
  1010. }
  1011.  
  1012. CEngine.SetOneTargetInitialState = function( strTargetID )
  1013. {// only invoked after ALL effects for the target have been set
  1014.     if( typeof(CEngine.objTarget[strTargetID]) == "object" ) 
  1015.     {// to get target object
  1016.         var objTarget = CEngine.objTarget[strTargetID];
  1017.         if( objTarget.SetState( "bsscpageload" ) == false )
  1018.         {
  1019.             objTarget.SetState( "bsscpageclick" );
  1020.             objTarget.SetState( "bssctrigger1" );
  1021.         }
  1022.     }
  1023. }
  1024.  
  1025. CEngine.AdjustPageClickCounter = function()
  1026. {
  1027.     var nAdjustedClickCounter = CTarget.nPageClickCounter;
  1028.     var bAdjusted = false;
  1029.     for( var strTargetID in CEngine.objTarget ) //to enumerate all target
  1030.     {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter
  1031.         var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;
  1032.         if( objEventPageClick != null )
  1033.         {
  1034.             for( var i = 0; i < objEventPageClick.length; i++ )
  1035.             {
  1036.                 var nOtherPageClick = objEventPageClick[i].nPageClick;
  1037.                 if( nOtherPageClick == CTarget.nPageClickCounter )
  1038.                     return;
  1039.                 if( nOtherPageClick > CTarget.nPageClickCounter )
  1040.                 {
  1041.                     if( !bAdjusted )
  1042.                     {
  1043.                         nAdjustedClickCounter = nOtherPageClick;
  1044.                         bAdjusted = true;
  1045.                     }
  1046.                     else if( nOtherPageClick < nAdjustedClickCounter )
  1047.                         nAdjustedClickCounter = nOtherPageClick;
  1048.                 }
  1049.             }
  1050.         }
  1051.     }
  1052.     CTarget.nPageClickCounter = nAdjustedClickCounter;
  1053. }
  1054.  
  1055. CEngine.OnPageLoad = function()
  1056. {     
  1057.     // first, to set all target's initial state
  1058.     for( var strTargetID in CEngine.objTarget )
  1059.         CEngine.SetOneTargetInitialState( strTargetID );
  1060.     
  1061.     // to invoke all target's onpageload handler
  1062.     CEngine.SendEventToAllTarget( "bsscpageload" );
  1063. }
  1064.  
  1065. CEngine.OnPageClick = function()
  1066. { // to invoke all target's onpageclick handler
  1067.     var src = CCSSP.GetEventElement( arguments[0] );
  1068.     if( src == null )
  1069.         return;
  1070.         
  1071.     var objClickedTrigger = null;
  1072.     for( var strTriggerID in CEngine.objTrigger )
  1073.     { // to detect which trigger is clicked
  1074.         if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )
  1075.         {
  1076.             objClickedTrigger = CEngine.objTrigger[strTriggerID];
  1077.             break;
  1078.         }
  1079.     }
  1080.     
  1081.     if( objClickedTrigger != null) // the clicked trigger found
  1082.         objClickedTrigger.OnTriggerClick();
  1083.     else // no trigger is clicked
  1084.     { // to send PageClick event to all target
  1085.         CTarget.nPageClickCounter++;
  1086.         CEngine.AdjustPageClickCounter();
  1087.         CEngine.SendEventToAllTarget( "bsscpageclick" );
  1088.     }
  1089. }    
  1090.  
  1091. CEngine.OnMouseOver = function()
  1092. { // to invoke all target's onpageload handler
  1093.     var src = CCSSP.GetEventElement( arguments[0] );
  1094.     if( src == null )
  1095.         return;
  1096.         
  1097.     var strHoveredTargetID = null;
  1098.     for( var strTargetID in CEngine.objTarget )
  1099.     { // to detect which Target is hovering on
  1100.         if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )
  1101.         {
  1102.             strHoveredTargetID = strTargetID;
  1103.             break;
  1104.         }
  1105.     }
  1106.     
  1107.     if( strHoveredTargetID != null ) // the hovered target found
  1108.         CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );
  1109. }
  1110.  
  1111. CEngine.BuildTargetObject = function(target_ID,event_type,action_type,
  1112.             action_setting, event_additional)
  1113. {// to build target object 
  1114.     // to get the target object
  1115.     if( typeof( CEngine.objTarget[target_ID] ) != "object" )
  1116.         return false;// the engine's AddOneTarget function might have failed.
  1117.     var TargetObject = CEngine.objTarget[target_ID];
  1118.     
  1119.     // to prepare the parameters for the event manager
  1120.     var arrEvent = event_type.split("|"); // to split the combined event_type string
  1121.     var arrAction = action_type.split("|");//to split the combined action_type string
  1122.     for( var trim = 0; trim < arrEvent.length; trim++ )
  1123.         arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);
  1124.     
  1125.     for( trim = 0; trim < arrAction.length; trim++ )
  1126.         arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);
  1127.     
  1128.     var arrSetting = new Array(); 
  1129.     if( typeof(action_setting) == "string" )
  1130.         arrSetting = action_setting.split("|");// to split the combined action_setting string
  1131.     // to calibrate the arrays
  1132.     for( var i = arrSetting.length; i < arrAction.length; i++ )
  1133.     {
  1134.         if( typeof(arrSetting[i]) != "string" )
  1135.              arrSetting[i] = "";
  1136.     }                 
  1137.  
  1138.     // to prepare for dealing with the absolute posioning element
  1139.     TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );
  1140.     TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );
  1141.  
  1142.     if( arrEvent.length > 1 )
  1143.     {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"
  1144.         if( arrAction.length != 2 )
  1145.             return false; // if event is combined, there must be 2 actions
  1146.         for( i = 0 ; i < 2; i++ )
  1147.         {
  1148.             if( TargetObject.SetEventManager(arrEvent[i], arrAction[i], 
  1149.                 arrSetting[i], event_additional) == false )
  1150.                 return false; // the event manager has not been set up
  1151.         }
  1152.     }
  1153.     else // the event_type string is not combined
  1154.     {
  1155.         for( i = 0 ; i < arrAction.length; i++ )
  1156.         {
  1157.             TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);
  1158.             // to validate the event manager
  1159.             if( typeof(TargetObject.objManager[event_type]) != "object" ||
  1160.                     typeof(TargetObject.objManager[event_type][i]) != "object" )
  1161.                 return false; // the event manager has not been set up
  1162.         }
  1163.     }
  1164.     return true;
  1165. }
  1166.  
  1167. CEngine.BuildTriggerObject = function(trigger_ID, target_ID)
  1168. {// to build the trigger object
  1169.     var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string
  1170.     for( var i = 0; i < arrTrigger.length; i ++ )
  1171.     {// to get the trigger element then add it to the trigger list
  1172.         arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );
  1173.         var eleTrigger = CCSSP.GetObject( arrTrigger[i] );
  1174.         if( eleTrigger == null )
  1175.             continue; // the trigger_ID string in the HTML code maybe wrong
  1176.         CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );
  1177.  
  1178.         // to get the target object
  1179.         if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )
  1180.             continue;// the engine's AddOneTarget function might have failed.
  1181.         CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );
  1182.     }
  1183. }
  1184. //End the definition of CEngine class
  1185.  
  1186. /// Section End  - CCSSP DHTM 1 (JavaScript 1.2)
  1187.  
  1188. /// Section Begin  - CCSSP DHTM 2 (JavaScript 1.2)
  1189.  
  1190. //Begin the definition of CAgencyXXXX classes
  1191.  
  1192. //Begin of the CAgencyShow definition
  1193. function CAgencyShow( element, bIsShow )
  1194. {
  1195.     this.ele = element;
  1196.     this.bIsShow = bIsShow;
  1197. }
  1198.  
  1199. CAgencyShow.prototype.PrepareEffect = function()
  1200. {
  1201.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  1202. }
  1203.  
  1204. CAgencyShow.prototype.UpdateEffect = function()
  1205. {
  1206.     CCSSP.ShowObject( this.ele, this.bIsShow );
  1207. }
  1208.  
  1209. CAgencyShow.prototype.EndEffect = function()
  1210. {
  1211.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  1212. }
  1213. // End of the CAgencyShow definition
  1214.  
  1215. // Begin of CAgencyFly definition
  1216. function CAgencyFly( element, settings, bIsIn )
  1217. {
  1218.     this.ele = element;
  1219.     this.bIsIn = bIsIn;
  1220.     this.duration = 1000; // default
  1221.     this.direction = "right";
  1222.  
  1223.     var arrAllSet = settings.split(",");
  1224.     for( var i = 0; i < arrAllSet.length; i ++ )
  1225.     {// to retrieve the setting
  1226.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1227.         var arrOneSet = arrAllSet[i].split("=");
  1228.         for( var j = 0; j < arrOneSet.length; j++ )
  1229.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1230.         switch( arrOneSet[0] )
  1231.         {
  1232.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  1233.         case "direction" : this.direction = arrOneSet[1]; break;
  1234.         }
  1235.     }
  1236.         
  1237.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  1238.         this.ele.style.position = "relative";
  1239.     this.timer = null;
  1240.     this.aniIndex = CEngine.arrAnimation.length;
  1241.     CEngine.arrAnimation[this.aniIndex] = this;
  1242. }
  1243.  
  1244. CAgencyFly.prototype.PrepareEffect = function()
  1245. {
  1246.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  1247. }
  1248.  
  1249. CAgencyFly.prototype.UpdateEffect = function()
  1250. {
  1251.     if( this.timer == null )
  1252.         this.ResetParameters();
  1253.  
  1254.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1255.     if( percent >= 1.0 )
  1256.         this.EndEffect();
  1257.     else
  1258.     {
  1259.         var newX = this.startX*(1.0-percent) +  this.finalX*percent;
  1260.         var newY = this.startY*(1.0-percent) +  this.finalY*percent;
  1261.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  1262.         if( this.timer == null )
  1263.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  1264.     }
  1265. }
  1266.  
  1267. CAgencyFly.prototype.EndEffect = function()
  1268. {
  1269.     clearInterval( this.timer );
  1270.     this.timer = null;
  1271.  
  1272.     if( this.bIsIn ) // FlyIn
  1273.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  1274.     else // FlyOut
  1275.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  1276.     CCSSP.ShowObject(this.ele, this.bIsIn );
  1277. }
  1278.  
  1279. CAgencyFly.prototype.ResetParameters = function()
  1280. {
  1281.     this.PrepareEffect();
  1282.     CCSSP.ShowObject(this.ele, true );
  1283.  
  1284.     this.startX = 0;
  1285.     this.startY = 0;
  1286.     this.finalX = 0;
  1287.     this.finalY = 0; 
  1288.     
  1289.     var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
  1290.     var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
  1291.     var offsetRight = CCSSP.GetWindowRight();
  1292.     var offsetBottom = CCSSP.GetWindowBottom();
  1293.  
  1294.     if( this.bIsIn )
  1295.     { // FlyIn
  1296.         this.finalX = this.ele.ABSX;
  1297.         this.finalY = this.ele.ABSY;
  1298.  
  1299.         switch( this.direction )
  1300.         {
  1301.         case "right": this.startX = offsetRight; this.startY = this.finalY; break;
  1302.         case "left": this.startX = -offsetLeft;  this.startY = this.finalY; break;
  1303.         case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
  1304.         case "up":  this.startY = -offsetTop;    this.startX = this.finalX; break;
  1305.         case "downright":
  1306.               this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  1307.             this.startY = this.startX;        break;
  1308.         case "upright":
  1309.               this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  1310.             this.startY = -this.startX;        break;
  1311.         case "upleft":
  1312.             this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  1313.             this.startY = this.startX;        break;
  1314.         case "downleft":
  1315.             this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  1316.             this.startY = -this.startX;     break;
  1317.         }
  1318.     }
  1319.     else
  1320.     { // FlyOut
  1321.         this.startX = this.ele.ABSX;
  1322.         this.startY = this.ele.ABSY;
  1323.  
  1324.         switch( this.direction )
  1325.         {
  1326.         case "right": this.finalX = offsetRight;  this.finalY = this.startY; break;
  1327.         case "left": this.finalX = -offsetLeft;   this.finalY = this.startY;  break;
  1328.         case "down": this.finalY = offsetBottom;  this.finalX = this.startX; break;
  1329.         case "up":  this.finalY = -offsetTop;     this.finalX = this.startX; break;
  1330.         case "downright":
  1331.               this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  1332.             this.finalY = this.finalX;        break;
  1333.         case "upright":
  1334.               this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  1335.             this.finalY = -this.finalX;        break;
  1336.         case "upleft":
  1337.             this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  1338.             this.finalY = this.finalX;        break;
  1339.         case "downleft":
  1340.             this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  1341.             this.finalY = -this.finalX;     break;
  1342.         }
  1343.     }
  1344.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  1345.     this.startTime = (new Date()).getTime();
  1346. }
  1347. // End of the CAgencyFly definition
  1348.  
  1349. // Begin of CAgencySpiral
  1350. function CAgencySpiral( element, settings, bIsIn )
  1351. {
  1352.     this.ele = element;
  1353.     this.bIsIn = bIsIn;
  1354.     this.duration = 1000; // default
  1355.  
  1356.     var arrAllSet = settings.split(",");
  1357.     for( var i = 0; i < arrAllSet.length; i ++ )
  1358.     {// to retrieve the setting
  1359.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1360.         var arrOneSet = arrAllSet[i].split("=");
  1361.         for( var j = 0; j < arrOneSet.length; j++ )
  1362.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1363.         switch( arrOneSet[0] )
  1364.         {
  1365.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  1366.         }
  1367.     }
  1368.  
  1369.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  1370.         this.ele.style.position = "relative";
  1371.     this.timer = null;
  1372.     this.aniIndex = CEngine.arrAnimation.length;
  1373.     CEngine.arrAnimation[this.aniIndex] = this;
  1374. }
  1375.  
  1376. CAgencySpiral.prototype.PrepareEffect = function()
  1377. {
  1378.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  1379. }
  1380.  
  1381. CAgencySpiral.prototype.UpdateEffect = function()
  1382. {
  1383.     if( this.timer == null )
  1384.         this.ResetParameters();
  1385.  
  1386.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1387.     if( percent >= 1.0 )
  1388.         this.EndEffect();
  1389.     else
  1390.     {
  1391.         var rf = (this.bIsIn)? (1.0 - percent) : percent; 
  1392.         var t = (1.0-rf) * 4.0 * Math.PI
  1393.         var rxP = (this.bIsIn)? this.startX : this.finalX; 
  1394.         var ryP = (this.bIsIn)? this.startY : this.finalY; 
  1395.         var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
  1396.         var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
  1397.  
  1398.         var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
  1399.         var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
  1400.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  1401.         if( this.timer == null )
  1402.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  1403.     }
  1404. }
  1405.  
  1406. CAgencySpiral.prototype.EndEffect = function()
  1407. {
  1408.     clearInterval( this.timer );
  1409.     this.timer = null;
  1410.     
  1411.     if( this.bIsIn ) // In
  1412.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  1413.     else // Out
  1414.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  1415.     CCSSP.ShowObject(this.ele, this.bIsIn );
  1416. }
  1417.  
  1418. CAgencySpiral.prototype.ResetParameters = function()
  1419. {
  1420.     this.PrepareEffect();
  1421.     CCSSP.ShowObject(this.ele, true );
  1422.     this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
  1423.     this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
  1424.     this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
  1425.     this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom(); 
  1426.     
  1427.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  1428.     this.startTime = (new Date()).getTime();
  1429. }
  1430. // End of CAgencySpiral
  1431.  
  1432. // Begin of CAgencyElastic
  1433. function CAgencyElastic( element, settings)
  1434. {
  1435.     this.ele = element;
  1436.     this.duration = 1000; // default
  1437.     this.direction = "right";
  1438.  
  1439.     var arrAllSet = settings.split(",");
  1440.     for( var i = 0; i < arrAllSet.length; i ++ )
  1441.     {// to retrieve the setting
  1442.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1443.         var arrOneSet = arrAllSet[i].split("=");
  1444.         for( var j = 0; j < arrOneSet.length; j++ )
  1445.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1446.         switch( arrOneSet[0] )
  1447.         {
  1448.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  1449.         case "direction" : this.direction = arrOneSet[1]; break;
  1450.         }
  1451.     }
  1452.         
  1453.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  1454.         this.ele.style.position = "relative";
  1455.     this.timer = null;
  1456.     this.aniIndex = CEngine.arrAnimation.length;
  1457.     CEngine.arrAnimation[this.aniIndex] = this;
  1458. }
  1459.  
  1460. CAgencyElastic.prototype.PrepareEffect = function()
  1461. {
  1462.     CCSSP.ShowObject(this.ele, false );
  1463. }
  1464.  
  1465. CAgencyElastic.prototype.UpdateEffect = function()
  1466. {
  1467.     if( this.timer == null )
  1468.         this.ResetParameters();
  1469.  
  1470.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1471.     if( percent >= 1.0 )
  1472.         this.EndEffect();
  1473.     else
  1474.     {
  1475.         var newX = this.startX;
  1476.         var newY = this.startY;
  1477.         var rf = Math.exp(-percent*3);
  1478.         var t = percent * 1.5 * Math.PI
  1479.         var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
  1480.         switch (this.direction )
  1481.         {
  1482.         case "left":   
  1483.         case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  1484.         case "up":       
  1485.         case "down" :  newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  1486.         }
  1487.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  1488.         if( this.timer == null )
  1489.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  1490.     }
  1491. }
  1492.  
  1493. CAgencyElastic.prototype.EndEffect = function()
  1494. {
  1495.     CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  1496.     clearInterval( this.timer );
  1497.     this.timer = null;
  1498. }
  1499.  
  1500. CAgencyElastic.prototype.ResetParameters = function()
  1501. {
  1502.     CCSSP.ShowObject(this.ele, true );
  1503.     this.startX = this.ele.ABSX;
  1504.     this.finalX = this.ele.ABSX;
  1505.     this.startY = this.ele.ABSY;
  1506.     this.finalY = this.ele.ABSY;
  1507.     
  1508.     switch (this.direction)
  1509.     { 
  1510.     case "left":  this.startX = -this.ele.offsetWidth; break;
  1511.     case "right": this.startX = this.ele.offsetWidth;  break;
  1512.     case "up":    this.startY = -this.ele.offsetHeight;break;
  1513.     case "down":  this.startY = this.ele.offsetHeight; break;
  1514.     }
  1515.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  1516.     this.startTime = (new Date()).getTime();
  1517. }
  1518. // End of CAgencyElastic
  1519.  
  1520. // Begin of CAgencyZoom
  1521. function CAgencyZoom( element, settings, bIsIn)
  1522. {
  1523.     this.ele = element;
  1524.     this.duration = 1000; // default
  1525.     
  1526.     var arrAllSet = settings.split(",");
  1527.     for( var i = 0; i < arrAllSet.length; i ++ )
  1528.     {// to retrieve the setting
  1529.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1530.         var arrOneSet = arrAllSet[i].split("=");
  1531.         for( var j = 0; j < arrOneSet.length; j++ )
  1532.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1533.         switch( arrOneSet[0] )
  1534.         {
  1535.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  1536.         }
  1537.     }
  1538.  
  1539.     this.bIsIn = bIsIn;
  1540.     this.timer = null;
  1541.     this.aniIndex = CEngine.arrAnimation.length;
  1542.     CEngine.arrAnimation[this.aniIndex] = this;
  1543. }
  1544.  
  1545. CAgencyZoom.prototype.PrepareEffect = function()
  1546. {
  1547.     CCSSP.ShowObject(this.ele, false);
  1548. }
  1549.  
  1550. CAgencyZoom.prototype.UpdateEffect = function()
  1551. {
  1552.     if( this.timer == null )
  1553.         this.ResetParameters();
  1554.  
  1555.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1556.     if( percent >= 1.0 )
  1557.         this.EndEffect();
  1558.     else
  1559.     {
  1560.         var nFactorIn = Math.ceil(50+50*percent);
  1561.         var nFactorOut = Math.ceil(100+200*(1-percent));
  1562.         var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
  1563.         var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
  1564.         
  1565.         this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
  1566.         for(var index = 0; index < this.ele.all.length; index++)
  1567.             this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
  1568.             
  1569.         if( this.timer == null )
  1570.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  1571.     }
  1572. }
  1573.  
  1574. CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
  1575. {
  1576.     if( CCSSP.IsTextTag(child) )
  1577.         child.style.fontSize = FontSize;
  1578.     else
  1579.     {
  1580.         if( typeof(child.orgWidth) == "number" )
  1581.             child.style.width = Factor * child.orgWidth;
  1582.         if( typeof(child.orgHeight) == "number" )
  1583.             child.style.height = Factor * child.orgHeight;
  1584.     }
  1585. }
  1586.  
  1587. CAgencyZoom.prototype.EndEffect = function()
  1588. {
  1589.     this.EndEffectAllChildren(this.ele);
  1590.     for(var index = 0; index < this.ele.all.length; index++)
  1591.         this.EndEffectAllChildren(this.ele.all[index]);
  1592.     
  1593.     clearInterval( this.timer );
  1594.     this.timer = null;
  1595. }
  1596.  
  1597. CAgencyZoom.prototype.EndEffectAllChildren = function( child )
  1598. {    
  1599.     if( CCSSP.IsTextTag(child) )
  1600.         child.style.fontSize = child.orgFontSize;
  1601.     else
  1602.     {
  1603.         if( typeof(child.intactWidth) != "undefined" )
  1604.         {
  1605.             child.width = child.intactWidth;
  1606.             child.height = child.intactHeight;
  1607.         }
  1608.         else if( typeof(child.style.intactPixelWidth) != "undefined" )
  1609.         {
  1610.             child.style.pixelWidth = child.style.intactPixelWidth;
  1611.             child.style.pixelHeight = child.style.intactPixelHeight;
  1612.         }
  1613.     }
  1614. }
  1615.  
  1616. CAgencyZoom.prototype.ResetParameters = function()
  1617. {
  1618.     this.PrepareEffect();
  1619.     this.ResetParametersAllChildren( this.ele );
  1620.     for(var index = 0; index < this.ele.all.length; index++)
  1621.         this.ResetParametersAllChildren(this.ele.all[index]);
  1622.         
  1623.     this.startTime = (new Date()).getTime();
  1624. }
  1625.  
  1626. CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
  1627. {
  1628.     CCSSP.ShowObject(child, true );
  1629.     if( (child.tagName == "DIV") && (child.parentElement.tagName == "TD") )
  1630.         child.width = "100%";// if the div is inside a cell of table, we need the this hack
  1631.     
  1632.     if( CCSSP.IsTextTag(child) )
  1633.         child.orgFontSize = child.style.fontSize;
  1634.     else
  1635.     {
  1636.         if( child.width > "" || child.height > "" )
  1637.         {
  1638.             child.orgWidth = child.intactWidth = child.width;
  1639.             child.orgHeight = child.intactHeight = child.height;
  1640.         }
  1641.         else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
  1642.         {
  1643.             child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
  1644.             child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
  1645.         }
  1646.     }
  1647. }
  1648. // End of CAgencyZoom
  1649.  
  1650. //// the following effects will use IE's exclusive "filter" function ////
  1651. // Begin of CAgencyAlpha definition
  1652. function CAgencyAlpha( element, settings, bIsIn )
  1653. {// because of "visual filter" style, this won't work in Navigator
  1654.     this.ele = element;
  1655.     this.bIsIn = bIsIn;
  1656.  
  1657.     // to set the default value
  1658.     this.startOpacity = (this.bIsIn) ? 0 : 100;
  1659.     this.endOpacity = (this.bIsIn) ? 100 : 0;
  1660.     
  1661.     this.duration = 1000; // default
  1662.     
  1663.     var arrAllSet = settings.split(",");
  1664.     for( var i = 0; i < arrAllSet.length; i ++ )
  1665.     {// to retrieve the setting
  1666.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1667.         var arrOneSet = arrAllSet[i].split("=");
  1668.         for( var j = 0; j < arrOneSet.length; j++ )
  1669.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1670.         switch( arrOneSet[0] )
  1671.         {
  1672.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  1673.         }
  1674.     }
  1675.     
  1676.     this.timer = null;
  1677.     this.aniIndex = CEngine.arrAnimation.length;
  1678.     CEngine.arrAnimation[this.aniIndex] = this;
  1679. }
  1680.  
  1681. CAgencyAlpha.prototype.PrepareEffect = function()
  1682. {// to set the visual filter function
  1683.     // the visual filter ONLY work when set by "Width and Height" or
  1684.     // absolute position for DIV, SPAN and normal tag ( such as p )
  1685.     // but, "absolute" cause the following elements overlap, so:
  1686.     CCSSP.PrepareFilter( this.ele );
  1687.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  1688. }
  1689.  
  1690. CAgencyAlpha.prototype.UpdateEffect = function()
  1691. {// to set the visual filter function
  1692.     if( this.timer == null )
  1693.         this.ResetParameters();
  1694.     if( typeof(this.ele.filters.alpha) != "object" )
  1695.     {
  1696.         this.EndEffect();
  1697.         return;
  1698.     }
  1699.  
  1700.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1701.     if( percent >= 1.0 )
  1702.         this.EndEffect();
  1703.     else if( typeof(this.ele.filters.alpha) == "object" )
  1704.     {
  1705.         this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
  1706.         if( this.timer == null )
  1707.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  1708.     }
  1709. }
  1710.  
  1711. CAgencyAlpha.prototype.EndEffect = function()
  1712. {// to remove the visual filter function
  1713.     clearInterval( this.timer );
  1714.     this.timer = null;
  1715.     this.ele.style.filter = "";
  1716.     CCSSP.ShowObject(this.ele, this.bIsIn );
  1717. }
  1718.  
  1719. CAgencyAlpha.prototype.ResetParameters = function()
  1720. {
  1721.     this.PrepareEffect();
  1722.     CCSSP.ShowObject(this.ele, true );
  1723.     this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
  1724.     this.startTime = (new Date()).getTime();
  1725. }
  1726. // End of the CAgencyAlpha definition
  1727.  
  1728. // Begin of CAgencyWave definition
  1729. function CAgencyWave( element, settings )
  1730. {// because of "visual filter" style, this won't work in Navigator
  1731.     this.ele = element;
  1732.  
  1733.     this.duration = 0; // default
  1734.     this.strength = 10;
  1735.     this.freq = 1;
  1736.     this.lightstrength = 1;
  1737.     
  1738.     var arrAllSet = settings.split(",");
  1739.     for( var i = 0; i < arrAllSet.length; i ++ )
  1740.     {// to retrieve the setting
  1741.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1742.         var arrOneSet = arrAllSet[i].split("=");
  1743.         for( var j = 0; j < arrOneSet.length; j++ )
  1744.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1745.         switch( arrOneSet[0] )
  1746.         {
  1747.         case "duration" : this.duration = 100000/arrOneSet[1]; break;
  1748.         case "strength" : this.strength = arrOneSet[1]; break;
  1749.         case "freq" : this.freq = arrOneSet[1]; break;
  1750.         case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
  1751.         }
  1752.     }
  1753.  
  1754.     this.timer = null;
  1755.     this.aniIndex = CEngine.arrAnimation.length;
  1756.     CEngine.arrAnimation[this.aniIndex] = this;
  1757. }
  1758.  
  1759. CAgencyWave.prototype.PrepareEffect = function()
  1760. {// to set the visual filter function
  1761.     CCSSP.PrepareFilter(this.ele);
  1762.  
  1763.     CCSSP.ShowObject(this.ele, true );
  1764. }
  1765.  
  1766. CAgencyWave.prototype.UpdateEffect = function()
  1767. {// to set the visual filter function
  1768.     if( this.timer == null )
  1769.         this.ResetParameters();
  1770.     if( typeof(this.ele.filters.wave) != "object" )
  1771.     {
  1772.         this.EndEffect();
  1773.         return;
  1774.     }
  1775.  
  1776.     if( this.duration > 0 )
  1777.     {
  1778.         var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  1779.         if( percent >= 1.0 )
  1780.         {
  1781.             this.EndEffect();
  1782.             return;
  1783.         }
  1784.     }
  1785.     
  1786.     this.ele.filters.wave.phase += 5;
  1787.     this.ele.filters.wave.phase %= 100;
  1788.     if( this.timer == null )
  1789.         this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
  1790. }
  1791.  
  1792. CAgencyWave.prototype.EndEffect = function()
  1793. {// to remove the visual filter function
  1794.     this.ele.style.filter = "";
  1795.     clearInterval( this.timer );
  1796.     this.timer = null;
  1797. }
  1798.  
  1799. CAgencyWave.prototype.ResetParameters = function()
  1800. {
  1801.     this.PrepareEffect();
  1802.     this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" + 
  1803.      this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
  1804.     this.startTime = (new Date()).getTime();
  1805. }
  1806. // End of the CAgencyWave definition
  1807.  
  1808. // Begin of CAgencyGlow definition
  1809. function CAgencyGlow( element, settings )
  1810. {// because of "visual filter" style, this won't work in Navigator
  1811.     this.ele = element;
  1812.  
  1813.     // to set the default value
  1814.     this.glowColor = "green";
  1815.     this.glowStrength = "3";
  1816.     
  1817.     var arrAllSet = settings.split(",");
  1818.     for( var i = 0; i < arrAllSet.length; i ++ )
  1819.     {
  1820.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1821.         var arrOneSet = arrAllSet[i].split("=");
  1822.         for( var j = 0; j < arrOneSet.length; j++ )
  1823.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1824.         switch( arrOneSet[0] )
  1825.         {
  1826.         case "color" : this.glowColor = arrOneSet[1]; break;
  1827.         case "strength" : this.glowStrength = arrOneSet[1]; break;
  1828.         }
  1829.     }
  1830. }
  1831.  
  1832. CAgencyGlow.prototype.PrepareEffect = function()
  1833. {
  1834.     CCSSP.PrepareFilter(this.ele);
  1835.     CCSSP.ShowObject(this.ele, true );
  1836.     if( this.ele.style.backgroundColor != "" )
  1837.     {//style.backgroundColor somehow stop the visual filter
  1838.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  1839.         this.ele.style.backgroundColor = "";
  1840.     }
  1841. }
  1842.  
  1843. CAgencyGlow.prototype.UpdateEffect = function()
  1844. {// to set the visual filter function
  1845.     this.PrepareEffect();
  1846.     this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" + 
  1847.         this.glowStrength + ", enabled=true" +")";
  1848. }
  1849.  
  1850. CAgencyGlow.prototype.EndEffect = function()
  1851. {// to remove the visual filter function
  1852.     this.ele.style.filter = "";
  1853.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  1854.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  1855. }
  1856. // End of the CAgencyGlow definition
  1857.  
  1858. // Begin of CAgencyDropShadow definition
  1859. function CAgencyDropShadow( element, settings )
  1860. {// because of "visual filter" style, this won't work in Navigator
  1861.     this.ele = element;
  1862.  
  1863.     // to set the default value
  1864.     this.shadowColor = "black"; 
  1865.     this.shadowOffx = "1";
  1866.     this.shadowOffy = "1";
  1867.     
  1868.     var arrAllSet = settings.split(",");
  1869.     for( var i = 0; i < arrAllSet.length; i ++ )
  1870.     {
  1871.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1872.         var arrOneSet = arrAllSet[i].split("=");
  1873.         for( var j = 0; j < arrOneSet.length; j++ )
  1874.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1875.         switch( arrOneSet[0] )
  1876.         {
  1877.         case "color" : this.shadowColor = arrOneSet[1]; break;
  1878.         case "offx" : this.shadowOffx = arrOneSet[1]; break;
  1879.         case "offy" : this.shadowOffy = arrOneSet[1]; break;
  1880.         }
  1881.     }
  1882. }
  1883.  
  1884. CAgencyDropShadow.prototype.PrepareEffect = function()
  1885. {
  1886.     CCSSP.PrepareFilter(this.ele);
  1887.     CCSSP.ShowObject(this.ele, true );
  1888.     
  1889.     if( this.ele.style.backgroundColor != "" )
  1890.     {//style.backgroundColor somehow stop the visual filter
  1891.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  1892.         this.ele.style.backgroundColor = "";
  1893.     }
  1894. }
  1895.  
  1896. CAgencyDropShadow.prototype.UpdateEffect = function()
  1897. {// to set the visual filter function
  1898.     this.PrepareEffect();
  1899.     this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" + 
  1900.         this.shadowOffx + ", offy=" + this.shadowOffy + ")";
  1901. }
  1902.  
  1903. CAgencyDropShadow.prototype.EndEffect = function()
  1904. {// to remove the visual filter function
  1905.     this.ele.style.filter = "";
  1906.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  1907.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  1908. }
  1909. // End of the CAgencyDropShadow definition
  1910.  
  1911. // Begin of CAgencyRevealTrans definition
  1912. function CAgencyRevealTrans( element, settings )
  1913. {// because of "visual filter" style, this won't work in Navigator
  1914.     this.ele = element;
  1915.  
  1916.     // to set the default value
  1917.     this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
  1918.     this.transition = 0;
  1919.     
  1920.     var arrAllSet = settings.split(",");
  1921.     for( var i = 0; i < arrAllSet.length; i ++ )
  1922.     {
  1923.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1924.         var arrOneSet = arrAllSet[i].split("=");
  1925.         for( var j = 0; j < arrOneSet.length; j++ )
  1926.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1927.         switch( arrOneSet[0] )
  1928.         {
  1929.         case "type" : this.transition = arrOneSet[1]; break;
  1930.         case "duration" : this.duration = 100/arrOneSet[1];    break;
  1931.         }
  1932.     }
  1933. }
  1934.  
  1935. CAgencyRevealTrans.prototype.PrepareEffect = function()
  1936. {
  1937.     CCSSP.PrepareFilter(this.ele);
  1938.     CCSSP.ShowObject( this.ele, false);
  1939. }
  1940.  
  1941. CAgencyRevealTrans.prototype.UpdateEffect = function()
  1942. {// to set the visual filter function
  1943.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  1944.     {
  1945.         if( this.ele.filters.RevealTrans.status == 2 )
  1946.             this.ele.filters.RevealTrans.stop();  
  1947.     }
  1948.  
  1949.     this.PrepareEffect();
  1950.     
  1951.     this.ele.style.filter = "RevealTrans(duration=" + this.duration + 
  1952.         ", transition=" + this.transition + ")";
  1953.     
  1954.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  1955.     {
  1956.         this.ele.filters.RevealTrans.apply();
  1957.         CCSSP.ShowObject( this.ele, true);
  1958.         this.ele.filters.RevealTrans.play();  
  1959.     }
  1960.     else
  1961.         CCSSP.ShowObject( this.ele, true);
  1962. }
  1963.  
  1964. CAgencyRevealTrans.prototype.EndEffect = function()
  1965. {
  1966.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  1967.         this.ele.filters.RevealTrans.stop();  
  1968.     this.ele.style.filter = "";
  1969. }
  1970. // End of the CAgencyRevealTrans definition
  1971.  
  1972. // Begin of CAgencyBlur definition
  1973. function CAgencyBlur( element, settings )
  1974. {// because of "visual filter" style, this won't work in Navigator
  1975.     this.ele = element;
  1976.  
  1977.     // to set the default value
  1978.     this.strength = "5";
  1979.     this.direction = "90";
  1980.     
  1981.     var arrAllSet = settings.split(",");
  1982.     for( var i = 0; i < arrAllSet.length; i ++ )
  1983.     {
  1984.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  1985.         var arrOneSet = arrAllSet[i].split("=");
  1986.         for( var j = 0; j < arrOneSet.length; j++ )
  1987.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  1988.         switch( arrOneSet[0] )
  1989.         {
  1990.         case "strength" : this.strength = arrOneSet[1]; break;
  1991.         case "direction" : this.direction = arrOneSet[1]; break;
  1992.         }
  1993.     }
  1994. }
  1995.  
  1996. CAgencyBlur.prototype.PrepareEffect = function()
  1997. {
  1998.     CCSSP.PrepareFilter(this.ele);
  1999.     CCSSP.ShowObject(this.ele, true );
  2000. }
  2001.  
  2002. CAgencyBlur.prototype.UpdateEffect = function()
  2003. {// to set the visual filter function
  2004.     CCSSP.PrepareFilter(this.ele);
  2005.     this.ele.style.filter = "blur(strength=" + this.strength + 
  2006.         ", direction=" + this.direction + ")";
  2007. }
  2008.  
  2009. CAgencyBlur.prototype.EndEffect = function()
  2010. {// to remove the visual filter function
  2011.     this.ele.style.filter = "";
  2012. }
  2013. // End of the CAgencyBlur definition
  2014.  
  2015. // Begin of CAgencyChangeFilter definition
  2016. function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
  2017. {// because of "visual filter" style, this won't work in Navigator
  2018.     this.ele = element;
  2019.  
  2020.     // to set the default value
  2021.     this.filterFunction = settings;
  2022. }
  2023.  
  2024. CAgencyChangeFilter.prototype.PrepareEffect = function()
  2025. {
  2026.     CCSSP.PrepareFilter(this.ele);
  2027.     CCSSP.ShowObject(this.ele, true );
  2028. }
  2029.  
  2030. CAgencyChangeFilter.prototype.UpdateEffect = function()
  2031. {// to set the visual filter function
  2032.     CCSSP.PrepareFilter(this.ele);
  2033.     this.ele.style.filter = this.filterFunction;
  2034. }
  2035.  
  2036. CAgencyChangeFilter.prototype.EndEffect = function()
  2037. {// to remove the visual filter function
  2038.     this.ele.style.filter = "";
  2039. }
  2040. // End of the CAgencyChangeFilter definition
  2041.  
  2042. // The effects below change the style on the fly, so they won't work in Navigator
  2043.  
  2044. // Begin of CAgencyFontChange definition, 
  2045. function CAgencyFontChange( element, settings )
  2046. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  2047.     this.ele = element;
  2048.     
  2049.     // to retrieve the original font style
  2050.     this.RetrieveOldFont( this.ele );
  2051.     
  2052.     // to set the default font to change
  2053.     this.newfontFamily = this.ele.oldFontFamily;
  2054.     this.newfColor = this.ele.oldColor;
  2055.     this.newtextDecoration = this.ele.oldTextDecoration;
  2056.     this.newfontWeight = this.ele.oldFontWeight;
  2057.     this.newfontStyle = this.ele.oldFontStyle;
  2058.     this.newfontSize = this.ele.oldFontSize;
  2059.     this.newBackgroundColor = this.ele.oldBackgroundColor;
  2060.     
  2061.     var arrAllSet = settings.split(",");
  2062.     for( var i = 0; i < arrAllSet.length; i ++ )
  2063.     {// to retrieve the setting
  2064.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  2065.         var arrOneSet = arrAllSet[i].split("=");
  2066.         for( var j = 0; j < arrOneSet.length; j++ )
  2067.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  2068.         switch( arrOneSet[0] )
  2069.         {
  2070.         case "font-family" : this.newfontFamily = arrOneSet[1]; break;
  2071.         case "color" : this.newfColor = arrOneSet[1]; break;
  2072.         case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
  2073.         case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
  2074.         case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
  2075.         case "size" : this.newfontSize = arrOneSet[1]; break;
  2076.         case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
  2077.         }
  2078.     }
  2079. }
  2080.  
  2081. CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
  2082. {
  2083.     if( typeof(objChild.oldFontFamily) == "undefined" )
  2084.         objChild.oldFontFamily = objChild.style.fontFamily;
  2085.     if( typeof(objChild.oldColor) == "undefined" )
  2086.         objChild.oldColor = objChild.style.color;
  2087.     if( typeof(objChild.oldTextDecoration) == "undefined" )
  2088.         objChild.oldTextDecoration = objChild.style.textDecoration;
  2089.     if( typeof(objChild.oldFontWeight) == "undefined" )
  2090.         objChild.oldFontWeight = objChild.style.fontWeight;
  2091.     if( typeof(objChild.oldFontStyle) == "undefined" )
  2092.         objChild.oldFontStyle = objChild.style.fontStyle;
  2093.     if( typeof(objChild.oldFontSize) == "undefined" )
  2094.         objChild.oldFontSize = objChild.style.fontSize;
  2095.     if( typeof(objChild.oldBackgroundColor) == "undefined" )
  2096.         objChild.oldBackgroundColor = objChild.style.backgroundColor;
  2097. }
  2098.  
  2099. CAgencyFontChange.prototype.PrepareEffect = function()
  2100. {
  2101.     // as for expanding text, the child is created after the constructor called
  2102.     for(var index = 0; index < this.ele.all.length; index++)
  2103.         this.RetrieveOldFont(this.ele.all[index]);
  2104.     CCSSP.ShowObject(this.ele, true );
  2105. }
  2106.  
  2107. CAgencyFontChange.prototype.UpdateEffect = function()
  2108. {// to change the font
  2109.     this.PrepareEffect();
  2110.     this.UpdateEffectAllChildren( this.ele );
  2111.     for( var index = 0; index < this.ele.all.length; index++)
  2112.         this.UpdateEffectAllChildren(this.ele.all[index]);
  2113. }
  2114.  
  2115. CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
  2116. {
  2117.     objChild.style.fontFamily = this.newfontFamily;
  2118.     objChild.style.color = this.newfColor;
  2119.     objChild.style.textDecoration = this.newtextDecoration;
  2120.     objChild.style.fontWeight = this.newfontWeight;
  2121.     objChild.style.fontStyle = this.newfontStyle;
  2122.     objChild.style.fontSize = this.newfontSize;
  2123.     objChild.style.backgroundColor = this.newBackgroundColor;
  2124. }
  2125.  
  2126. CAgencyFontChange.prototype.EndEffect = function()
  2127. {// to reinstate the original font style
  2128.     this.EndEffectAllChildren( this.ele );
  2129.     for( var index = 0; index < this.ele.all.length; index++)
  2130.         this.EndEffectAllChildren(this.ele.all[index]);
  2131. }
  2132.  
  2133. CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
  2134. {
  2135.     if( typeof(objChild.oldFontFamily) != "undefined" )
  2136.         objChild.style.fontFamily = objChild.oldFontFamily;
  2137.     if( typeof(objChild.oldColor) != "undefined" )
  2138.         objChild.style.color = objChild.oldColor;
  2139.     if( typeof(objChild.oldFontWeight) != "undefined" )
  2140.         objChild.style.fontWeight = objChild.oldFontWeight;
  2141.     if( typeof(objChild.oldFontStyle) != "undefined" )
  2142.         objChild.style.fontStyle = objChild.oldFontStyle;
  2143.     if( typeof(objChild.oldFontSize) != "undefined" )
  2144.         objChild.style.fontSize = objChild.oldFontSize;
  2145.     if( typeof(objChild.oldTextDecoration) != "undefined" )
  2146.         objChild.style.textDecoration = objChild.oldTextDecoration;
  2147.     if( typeof(objChild.oldBackgroundColor) != "undefined" )
  2148.         objChild.style.backgroundColor = objChild.oldBackgroundColor;
  2149. }
  2150. // End of the CAgencyFontChange definition
  2151.  
  2152. // Begin of the CAgencyChangeStyle definition
  2153. function CAgencyChangeStyle( element, settings )
  2154. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  2155.     this.ele = element;
  2156.     
  2157.     // to retrieve the original style
  2158.     this.oldstyle = this.ele.style.cssText;
  2159.     
  2160.     // to set the default style
  2161.     this.newStyle = this.oldstyle;
  2162.     
  2163.     if( typeof(settings) == "string" && settings.length > 1 )
  2164.         this.newStyle = this.oldstyle + " " + settings;
  2165. }
  2166.  
  2167. CAgencyChangeStyle.prototype.PrepareEffect = function()
  2168. {
  2169.     CCSSP.ShowObject(this.ele, true );
  2170. }
  2171.  
  2172. CAgencyChangeStyle.prototype.UpdateEffect = function()
  2173. {// to change the style
  2174.     this.ele.style.cssText = this.newStyle;
  2175. }
  2176.  
  2177. CAgencyChangeStyle.prototype.EndEffect = function()
  2178. {// to reinstate the original style
  2179.     this.ele.style.cssText = this.oldStyle;
  2180. }
  2181. // End of the CAgencyChangeStyle definition
  2182.  
  2183. //End the definition of CAgencyXXXX classes
  2184.  
  2185. //Begin to collaborate with other event handler settings 
  2186. CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
  2187. CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
  2188. CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
  2189. CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
  2190. CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
  2191. //End to collaborate with other event handler settings
  2192.  
  2193.  
  2194. /// Section End  - CCSSP DHTM 2 (JavaScript 1.2)
  2195.  
  2196. //// Segment End -- (JavaScript 1.2)
  2197.